%Experiment: Within the available data, use a window W, for calculating
% entropy. The corresponding outcomes are those in later 1hr, or 2hr ...
% or even refine them to later 1.5 hr etc.

% Within each window W, use slice size L to calculate the permutation
% entropy.

% Above gives a training and testing set.

% load data
% This is a dataset for 2011/07/18 to 2011/07/24 outer loop of I494, MN
load 'data/dataset04-Dec-2011-I494.mat'); %struct 'dataset'

%------------------------------------
%a section to set all parameters here
%------------------------------------
param.W = 12 * 60 * 2; %the big window for an entropy value; 12hours*60min*2for each min
param.W_step = 15 * 2; % stepsize of sliding this big window; 15min*2for each min
param.rangeWin = [5 10 15 30]*2; %the slice length; [...]min*2for each min
param.rangeAlpha = 0.6:0.01:2.0; %parameter alpha in the Renyi entropy
param.alphabetChoice = 2; % 2: permutation in bag
param.kFold = 10;
param.noRepeats = 1;
param.delays = [10 15 30]*2; % time when the future outcomes happen
param.options1 = [0 0]; %option1(1) if re-construct the training set, or load it
                  %option2(2) 
                  
param.sensors = [23 24 25 26 27]; % index of sensors in the raw dataset
param.start_shift = 0; % choose a start time point for the window
param.classifier = 'tree'; % 'discriminant' 'svm' 'tree'
param.tree.pruneFlag = 0;
%construct or load the training set
if param.options1(1) == 1
    load 'data/training.mat';
else
    